
Ext.ClassManager.create('ape.view.usuariosistema.CreateAdminView', {
	extend: 'Ext.form.Panel',
	alias: 'widget.createAdminForm',
	id: 'UsuarioAdmin',
	url: 'usuarioAdmin',
	width: '100%',
	//frame: true,
    title: 'Crear Usuario Administrador',
	defaults: {
		//anchor: '50%',
		labelAlign: 'right',
		labelPad: 20,
		labelWidth: '45%',
		/*
		 * padding
		 * 1 elemento es de arriba
		 * 2 elemento es de izq
		 * 3 elemento es la derecha
		 * 
		 */
		padding: '5 20 20 0',
		anchor: '100%'
	},
	
	initComponent: function() {
		this.items = [{
			xtype: 'textfield',
			id: 'perfilRole-usuarioAdmin',
			fieldLabel: 'Perfil',
			maxLength:50,
			readOnly: true,
			name: 'perfilRole',
			size: 55,
			value: 'Administrador'
		},{
			xtype: 'textfield',
			id: 'username-usuarioAdmin',
			fieldLabel: 'Nombre Usuario Sistema',
			maxLength:15,
			allowBlank: false,
			name: 'username',
			size: 20
		},{
			xtype: 'textfield',
			id: 'nombre-usuarioAdmin',
			fieldLabel: 'Nombre',
			maxLength:15,
			allowBlank: true,
			name: 'nombre',
			size: 20
		},{
			xtype: 'textfield',
			id: 'apPaterno-usuarioAdmin',
			fieldLabel: 'Apellido Paterno',
			maxLength:15,
			allowBlank: true,
			name: 'apPaterno',
			size: 20
		},{
			xtype: 'textfield',
			id: 'apMaterno-usuarioAdmin',
			fieldLabel: 'Apellido Materno',
			maxLength:15,
			allowBlank: true,
			name: 'apMaterno',
			size: 20
		},{
			xtype: 'textfield',
			id: 'email-usuarioAdmin',
			fieldLabel: 'Email',
			maxLength:15,
			allowBlank: true,
			name: 'email',
			inputType: "email",
			size: 20
		},{
			xtype: 'textfield',
			id: 'password-usuarioAdmin',
			fieldLabel: 'Password',
			maxLength:15,
			allowBlank: false,
			name: 'password',
			inputType: "password",
			size: 20
		},{
			xtype: 'textfield',
			id: 'password1-usuarioAdmin',
			fieldLabel: 'Confirmar Password',
			maxLength:15,
			allowBlank: false,
			name: 'password1',
			inputType: "password",
			size: 20,
			validator: function(value) {
                var password = this.previousSibling('[name=password]');
                return (value === password.getValue()) ? true : 'Los password no coinciden.'
            }
		}];
		
		this.buttons = [{
			text: 'Crear Usuario',
			id:'idButtonCrearUsuario',
			formBind: true
		}];
		
		this.callParent(arguments);
	}
});


